<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@page import="com.yaodian100.mall.member.util.UserData"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu" %>
<%@taglib uri="/WEB-INF/tld/mallutil.tld" prefix="mu" %>
<%@page import="java.util.Date"%>
<%@page import="java.util.Calendar"%>
<%@page import="org.apache.commons.lang.time.DateUtils"%>
<link rel="stylesheet" href="/css/yaotuangou.css" type="text/css" />
<c-rt:set var="hostName" value='<%=request.getServerName()%>'/>
<c-rt:set var="frontendContextPath"><%=ServerValue.getFrontContextPath()%></c-rt:set>
<%
	request.setAttribute("application", application);
%>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.alphanumeric.js"></script>
<script type="text/javascript" src="/js/pageable.js"></script>
<script language="javascript">
$().ready(function(){
		if ( !isLogin() ){
			window.location.replace("<%=ServerValue.getFrontContextPath()%>/tologin.do?redirect_url=http%3A%2F%2F<%=request.getServerName()%><%=ServerValue.getFrontContextPath()%>/shopping/orderprize/orderPrize.do?tuangouId="+ $('#tuangouId').val() );
		}else{
			$("#mobile").numeric();
			$("#chang_image").click(function(){
				$("#iv").attr("src","<%=ServerValue.getFrontContextPath()%>/servlet/imageValid.jpg?"+Math.random());
			});
			$("#iv").attr("src","<%=ServerValue.getFrontContextPath()%>/servlet/imageValid.jpg?"+Math.random());
			$("#go_next").click(function() {
				$("#mobiileTip").hide();
				$("#cityTip").hide();
				$("#codeTip").hide();
				if(trim($("#mobile").val())==""){
		    		$("#mobiileTip").html('请输入手机号码');
		     		$("#mobiileTip").show();
							return false;
				}	
				//if(trim($("#city").val())==""){
		    	//	$("#cityTip").html('请输入所在城市');
		     	//	$("#cityTip").show();
				//			return false;
				//}
		
				//输入验证码
			    if(($("#ccode").attr('value') == "")){
			  	  	$("#ccode").focus();	
			     		$("#codeTip").html('请输入校验码');
			     		$("#codeTip").show();
								return false;
			    }else{
			  	  $.post("<%=ServerValue.getFrontContextPath()%>/shopping/jsonChkValidateNum.do",{ccode:$("#ccode").val()},
							ccodeCallback,"json");
			    }
			    $("#orderPrizeForm").submit();
				return false;	
			});
		}
	function ccodeCallback(ccodeResult){
		if(ccodeResult == "error"){
			$("#ccode").focus();	
			$("#codeTip").html('验证码错误，请重新输入');
			$("#iv").attr("src","<%=ServerValue.getFrontContextPath()%>/servlet/imageValid.jpg?"+Math.random());
			$("#codeTip").show();
			return false;
		}else{
			alert('OK');
			return false;
		}
	}
	//去除字串左邊的空白虛格
	function ltrim(instr){
	return instr.replace(/^[\s]*/gi,"");
	}
	//去除字串右邊的空白虛格
	function rtrim(instr){
	return instr.replace(/[\s]*$/gi,"");
	}
	//去除字串前後的空白虛格
	function trim(instr){
	instr = ltrim(instr);
	instr = rtrim(instr);
	return instr;
	}
});
</script>
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta http-equiv="description" content="耀点100让您享受诚信满意的购物体验，提供女装、男装、内睡衣、美妆、鞋、包、饰品、珠宝、表、奢侈品、家居、床品、家电、数码、母婴、台湾精品，100%正品，支持免费退换货。" />
<meta http-equiv="keywords" content="耀点100,耀团购,团购,tuangou,yaodian100,yaodian" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" href="/css/yaotuangou.css" type="text/css" />
<link rel="Canonical" href="http://www.yaodian100.com/" > 
<title>耀团购 - 享受诚信满意的购物体验 - 耀点100</title>
</head>
<body class="payment">
  <!-- main start -->
  <div id="main">
    <!-- content start -->
       <!-- START 参加抽奖表格 -->
           <s:form action="orderprize/orderPrizeExe.do" id="orderPrizeForm" name="orderPrizeForm" method="post">
			<input type="hidden" id="tuangouId" name="tuangouId" value="${tuangouId}" />
			<c-rt:if test="${canOrder=='true'}">	
			  <div class="payment-box">
           		<h3>订单</h3>
				 <div class="payment-content">
		           	<h1>${shelfTuangou.promoteName}</h1>
		            <p>请填写您的手机号码和所在城市，活动结束后我们会进行抽奖，并通过手机号码与中奖用户联系，祝您好运！</p>
		            <dl class="gamer-data">
		                <dt>手机号码：</dt>
		                <dd><input type="text" name="mobile" id="mobile"  value="" size="18" maxlength="11"/><span id="mobiileTip" style="display:none">请输入手机号码</span></dd>
		                <dt>所在城市：</dt>
		                <dd><input type="text" name="city" id="city"  value="" size="18" maxlength="11"/>
					<span style="display:block"><span id="cityTip" class="msg rn" style="display:none">请输入所在城市</span></span></dd>
		                <dt>验证码：</dt>
		                <dd><input type="text" name="ccode" id="ccode" maxlength="6"  autocomplete="off">
						    	 		<img id="iv" name="iv" class="captcha"> <a href="#chImg" id="chang_image">换张图</a><span style="display:block"><span id="codeTip" style="display:none">请输入校验码</span></span></dd>
		            </dl>
		            <p class="payment-confirm step2">
		            <a class="btn-mid" id="go_next" href="javascript:void(0);">提交订单</a>
		            <em>请核对以上信息，确认无误后点击"提交订单"。</em>
		            </p>
	           	</div>
	           	</div>
			</c-rt:if>
			<c-rt:if test="${canOrder=='false'}">	
		       <!-- START 已参加过抽奖状况 -->
		       <div class="payment-box">
		           <h3 title="${shelfTuangou.promoteName}">${shelfTuangou.promoteName}</h3>
		           <div class="payment-content">
		            <p>您已经参与过此抽奖活动， 请到<a href="<%=ServerValue.getFrontContextPath()%>/member/myOrder/showOrders.do?t=OP&p=1" title="我的团购"> 我的团购</a>中查看。</p>
		           </div>
			   </div>
		       <!-- END 已参加过抽奖状况 -->  
			</c-rt:if>
			<c-rt:if test="${canOrder=='errorId'}">	
				 <div class="payment-box">
		           <h3>无此团购编号</h3>
		           <div class="payment-content">
		            <p>无此团购编号。</p>
		           </div>
			   </div>
			</c-rt:if>
			<c-rt:if test="${canOrder=='orderSuccess'}">	
			 <!-- START 订单提交成功 -->
		       <div class="payment-box">
		           <h3 title="${shelfTuangou.promoteName}">${shelfTuangou.promoteName}</h3>
		           <div class="payment-content">
					<h1>恭喜！订单提交成功了！</h1>
		            <p>订单提交成功，请到 <a href="<%=ServerValue.getFrontContextPath()%>/member/myOrder/showOrders.do?t=OP&p=1" title="我的团购">我的团购</a> 中查看。</p>
		           </div>
			   </div>
		       <!-- END 订单提交成功 -->
			</c-rt:if>
			<c-rt:if test="${canOrder=='memberNotLogin'}">	
				<div class="payment-box">
		           <h3>会员尚未登入，请登入!</h3>
		           <div class="payment-content">
		            <p>会员尚未登入，请登入!</p>
		           </div>
			   </div>
			</c-rt:if>
			<c-rt:if test="${canOrder=='errorProductType'}">	
				<div class="payment-box">
		           <h3>抽奖商品型态错误!</h3>
		           <div class="payment-content">
		            <p>抽奖商品型态错误!</p>
		           </div>
			   </div>
			</c-rt:if>
			<c-rt:if test="${canOrder=='errorProductIsDelete'}">	
				<div class="payment-box">
		           <h3>抽奖商品销售状态错误!</h3>
		           <div class="payment-content">
		            <p>抽奖商品销售状态错误!</p>
		           </div>
			   </div>
			</c-rt:if>
			<c-rt:if test="${canOrder=='errorMemberLimit'}">	
				<div class="payment-box">
		           <h3>单个会员限购买一件时，每个会员只能抽一次!</h3>
		           <div class="payment-content">
		            <p>单个会员限购买一件时，每个会员只能抽一次!</p>
		           </div>
			   </div>
			</c-rt:if>
			<c-rt:if test="${canOrder=='outOfdate'}">	
				<div class="payment-box">
		           <h3>活动已结束!</h3>
		           <div class="payment-content">
		            <p>活动已结束!</p>
		           </div>
			   </div>
			</c-rt:if>
			
			 </s:form>
	   
       <!-- END 参加抽奖表格 -->    
  </div><!-- main end -->
</div>
</body>
</html>
